package com.facebook.utils 
{

	/**
	 * @author Ben Smith
	 */
	public class SQL extends Object 
	{
		
		static public const SELECT:String="SELECT";
		static public const WHERE:String="WHERE";
		static public const FROM:String="FROM";
		
		public var _request:String
		
		
		private var _select:Vector.<String>
		private var _where:String
		private var _from:String
		private var _conditionalSQL:SQL
		
		
		public function SQL(){}

		
		public function toString():String{
			return "SELECT "+ _select.join(",") + " FROM " + _from +  " WHERE " +  _where;
		}
		
		public function get select() : Vector.<String> {
			return _select;
		}
		
		public function set select(select : Vector.<String>) : void {
			_select = select;
		}
		
		public function get where() : String {
			return _where;
		}
		
		public function set where(where : String) : void {
			_where = where;
		}
		
		public function get from() : String {
			return _from;
		}
		
		public function set from(from : String) : void {
			_from = from;
		}
		/*conditions()
		 * use this method when using conditionalSQL
		 */
		public function get conditions():String{
			return "("+ _conditionalSQL.toString()+ ")"
		}
		
		public function get conditionalSQL() : SQL {
			return _conditionalSQL;
		}
		
		public function set conditionalSQL(conditionalSQL : SQL) : void {
			_conditionalSQL = conditionalSQL;
		}
	}
}
